package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AreatospotMapper;
import com.ruoyi.system.domain.Areatospot;
import com.ruoyi.system.service.IAreatospotService;
import com.ruoyi.common.core.text.Convert;

/**
 * 景区景点Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-10-15
 */
@Service
public class AreatospotServiceImpl implements IAreatospotService 
{
    @Autowired
    private AreatospotMapper areatospotMapper;

    /**
     * 查询景区景点
     * 
     * @param id 景区景点ID
     * @return 景区景点
     */
    @Override
    public Areatospot selectAreatospotById(Long id)
    {
        return areatospotMapper.selectAreatospotById(id);
    }

    /**
     * 查询景区景点列表
     * 
     * @param areatospot 景区景点
     * @return 景区景点
     */
    @Override
    public List<Areatospot> selectAreatospotList(Areatospot areatospot)
    {
        return areatospotMapper.selectAreatospotList(areatospot);
    }

    /**
     * 新增景区景点
     * 
     * @param areatospot 景区景点
     * @return 结果
     */
    @Override
    public int insertAreatospot(Areatospot areatospot)
    {
        areatospot.setCreateTime(DateUtils.getNowDate());
        return areatospotMapper.insertAreatospot(areatospot);
    }

    /**
     * 修改景区景点
     * 
     * @param areatospot 景区景点
     * @return 结果
     */
    @Override
    public int updateAreatospot(Areatospot areatospot)
    {
        areatospot.setUpdateTime(DateUtils.getNowDate());
        return areatospotMapper.updateAreatospot(areatospot);
    }

    /**
     * 删除景区景点对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAreatospotByIds(String ids)
    {
        return areatospotMapper.deleteAreatospotByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除景区景点信息
     * 
     * @param id 景区景点ID
     * @return 结果
     */
    @Override
    public int deleteAreatospotById(Long id)
    {
        return areatospotMapper.deleteAreatospotById(id);
    }
}
